package com.dianrui.moonfire.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dianrui.moonfire.R;
import com.dianrui.moonfire.bean.WalletListBean;
import com.dianrui.moonfire.util.GlideUtil;

import java.util.List;

public class WalletListMainAdapter extends BaseQuickAdapter<WalletListBean,BaseViewHolder> {
    private Context context;


    public WalletListMainAdapter(@Nullable List<WalletListBean> data,Context context) {
        super(R.layout.item_order_list_main);
        this.context=context;
    }

    @Override
    protected void convert(BaseViewHolder helper, WalletListBean item) {
        helper.setText(R.id.name,item.name);
        StringBuilder numberBuilder=new StringBuilder();
        numberBuilder.append("累计借车").append(item.number).append("次");
        helper.setText(R.id.number,numberBuilder.toString());
        GlideUtil.loadImageView(context,item.logo,(ImageView) helper.getView(R.id.logo));
    }
}
